; RedGuard Global function, flag and equate definition file

[functions]

; functions section.
; functions defined as xxx parms y
; where xxx is an ascii name for the function and y is the number of parameters
; the function takes.

task		sRotate				parms 4
task		sRotateByAxis			parms 3
task		sRotateToAxis			parms 3
task		sMove				parms 4
task		sMoveByAxis			parms 3
task		sMoveAlongAxis			parms 3
function	HeaderHook			parms 0
task		swordAI			 	parms 0
task		projectileAI 			parms 0
function	chargeWeapon			parms 1
function	PlayerMain			parms 0
function	PrintParms			parms 8
function	LogParms			parms 8
function	PrintStringParm			parms 1
function	PrintSingleParm			parms 1
function	SpacePressed			parms 0
task		WaitOnTasks			parms 0
function	updatePlayerViewAttrib		parms 0
function	cameraController		parms 0
task		showObjRot			parms 8
task		showObj				parms 3
task		showObjLoc			parms 3
task		showObjPan			parms 4
task		showObjPanLoc			parms 4
task		lookObj				parms 1
task		showPlayer			parms 0
task		showPlayerPan			parms 1
task		lookCyrus			parms 1
task		showCyrus			parms 3
task		showCyrusLoc			parms 3
task		showCyrusPan			parms 4
task		showCyrusPanLoc			parms 4
function	PlayAnimation			parms 2
function 	lockoutPlayer			parms 1
function 	menuNew				parms 0
task 		menuProc			parms 0
function 	menuAddItem			parms 3
function 	menuSelection			parms 0
task		RTX				parms 1
task		rtxAnim				parms 4
task		RTXpAnim			parms 4
task		RTXp				parms 1
task		Rotate				parms 4
task		RotateByAxis			parms 3
task		RotateToAxis			parms 3
task		WalkForward			parms 1
task		WalkBackward			parms 1
task		MoveForward			parms 1
task		MoveBackward			parms 1
task		MoveLeft			parms 1
task		MoveRight			parms 1
task		Move				parms 4
task		MoveByAxis			parms 3
task		MoveAlongAxis			parms 3
task		MoveObjectAxis			parms 3
task		MoveToLocation			parms 2
task		WanderToLocation		parms 2
task		MoveToMarker			parms 2
function	SetObjectLocation		parms 4
task		Wait				parms 1
function	DistanceFromStart		parms 1
function	Light				parms 2
function	LightRadius			parms 1
function	LightIntensity			parms 1
function	LightOff			parms 0
function	LightOffset			parms 3
function	LightFlicker			parms 2
function	FlickerLight			parms 1
function	LightFlickerOff			parms 0
function	LightSize			parms 2
function	LightSizeOff			parms 0
multitask	FxPhase				parms 7
multitask	FxFlickerOnOff			parms 1
multitask	FxFlickerDim			parms 1
multitask	FxLightSize			parms 2
function	Flat				parms 1
function	FlatSetTexture			parms 2
function	FlatOff				parms 0
function	FlatOffset			parms 3
function	FlatLikeStatic			parms 1
function	FlatAnimate			parms 3
function	FlatStop			parms 0
function	SetAttribute			parms 2
function	GetAttribute			parms 1
function	SetGlobalFlag			parms 1
function	TestGlobalFlag			parms 1
function	ResetGlobalFlag			parms 1
task		FacePlayer			parms 1
task		FacePlayerInertia		parms 1
task		FaceAngle 			parms 1
task		FacePos				parms 2
task		FaceObject			parms 1
function	Sound				parms 3
function	FlatSound			parms 3
multitask	AmbientSound			parms 3
multitask	AmbientRtx			parms 3
function	Jump				parms 0
task		WaitNonMulti			parms 0
task		WaitOnDialog			parms 0
function	HideMe				parms 0
function	ShowMe				parms 0
function	Rnd				parms 1
function	QuickRnd			parms 1
function	MyId				parms 0
task		FaceLocation			parms 2
function	DistanceFromLocation		parms 1
function	LoadWorld			parms 3
function	SetAiType			parms 1
function	SetAiMode			parms 1
function	MyAiType			parms 0
function	MyAiMode			parms 0
task		GotoLocation			parms 1
task		Guard				parms 3
task		Animal				parms 2
function	TrueFunction			parms 0
function	TurnToPos			parms 2
function	AtPos				parms 3
function	TurnToAngle			parms 1
function	MovePos				parms 3
function	SetStartPosition		parms 3
function	GetMyAttr			parms 1
function	SetMyAttr			parms 2
function	GetFramePassed			parms 0
function	SpeedScale			parms 1
function	InKey				parms 1
function	PressKey			parms 1
FUNCTION	ACTIVATE			PARMS 1
function	TorchActivate			parms 1
function	Deactivate			parms 0
function	ReleaseAnimation		parms 0
function	HoldAnimation			parms 0
function	PauseAnimation			parms 1
function	SetAction			parms 1
function	ResetAction			parms 1
function	ResetAllAction			parms 0
task		PushAnimation			parms 2
task		PushControlAnimation		parms 2
task		WaitAnimFrame			parms 2
task		WaitPlayerAnimFrame		parms 2
function	KillMyTasks			parms 0
task		ObjectLineUp			parms 3
task		ObjectParallelLineUp		parms 3
task		ObjectPickupLineUp		parms 3
task		LineUp				parms 3
task		WaitLineUp			parms 1
function	MoveAboveMe			parms 4
function	KillMe				parms 0
function	EndSound			parms 1
function	EndMySounds			parms 0
function	EndMySound			parms 1
function	StopAllSounds			parms 0
task		ViewGXA				parms 3
task		AnimateGXA			parms 4
function	PlayerOffset			parms 3
multitask	PlayerOffsettask		parms 3
function	Offset				parms 3
function	UnOffset			parms 0
task		BounceObject			parms 3
function	OffsetLocation			parms 4
function	DistanceToLocation		parms 1
function	ShowBitmap                      parms 2
function	UnShowBitmap			parms 1
function	ReplenishHealth			parms 0
function	InRectangle			parms 4
function	InCircle			parms 3
function	ScriptParticles			parms 8
function	LightTorch			parms 0
function	UnlightTorch			parms 0
function	LoadStatic			parms 1
function	UnLoadStatic			parms 0
function	PointAt				parms 0

; combat commands

function	beginCombat			parms 0
function	endCombat			parms 0
function	isFighting			parms 0
function	isDead				parms 0
function	adjustHealth			parms 2
function	setHealth			parms 1
function	health				parms 0
function	adjustStrength			parms 1
function	setStrength			parms 1
function	strength			parms 0
function	adjustArmor			parms 1
function	setArmor			parms 1
function	armor				parms 0
function	shoot				parms 7
function	shootPlayer			parms 4
function	resurrect			parms 0

; object script/task control

function	EnableObject			parms 0
function	DisableObject			parms 0
function	EnableTasks			parms 0
function	DisableTasks			parms 0
function	EnableScript			parms 0
function	DisableScript			parms 0
function	EnableHook			parms 0
function	DisableHook			parms 0
function	EnableCombat			parms 0
function	DisableCombat			parms 0

; rotational and positional reset commands

function	SetRotation			parms 3
function	SetPosition			parms 3
function	ResetRotation			parms 3
function	ResetPosition			parms 3
function	ReloadRotation			parms 0
function	ReloadPosition			parms 0
function	SetLocation			parms 1

; master and slave commands

function	AttachMe			parms 1
function	DetachMe			parms 0
function	DetachSlaves			parms 0
function	KillSlaves			parms 0
function	HideSlaves			parms 0
function	ShowSlaves			parms 0
function	EnableSlaves			parms 0
function	DisableSlaves			parms 0
function	IsSlave				parms 0
function	IsMaster			parms 0
function	FixSlaveAngle			parms 2

; player commands

function	PlayerMoved			parms 0
function	PlayerTurned			parms 0
function	PlayerTurnedDirection		parms 0
function	PlayerMovementSpeed		parms 0
function	GetMovementSpeed		parms 0
function	PlayerHealth			parms 0
function	PlayerStatus			parms 0
function	PlayerCollide			parms 0
function	PlayerStand			parms 0
function	PlayerArmed			parms 0
function	PlayerHanging			parms 0
function	PlayerInSight			parms 0
function	PlayerDistance			parms 0
function	AcuratePlayerDistance		parms 0
function	PlayerFacing			parms 2
function	PlayerArcTan			parms 0
function	PlayerArc			parms 2
function	PlayerLooking			parms 1
multitask	PlayerTilt			parms 3
multitask	PlayerTiltRevx			parms 3
function	PlayerSnap			parms 3
task		PlayerLineUp			parms 3
task		PlayerParallelLineUp		parms 3
task		PlayerPickupLineUp		parms 3
function	MovePlayerAboveMe		parms 4
function	PushPlayer			parms 1
function	PopPlayer			parms 0
task		PlayerFaceObj			parms 0
function	PlayerOnScape			parms 0
function	PlayerCollideStatic		parms 0
function	WonGame				parms 0
function	MainloopExit			parms 1
task		PlayerFaceTalk			parms 1
function	PlayerForceTalk			parms 1
function	CollidePlayerWeapon		parms 4

; object and player health

function	ZapPlayer			parms 1
function	ZapPlayerNoKill			parms 1
function	ZapObject			parms 1
function	ZapObjectNoKill			parms 1

; object system messaging

function	SendMessage			parms 1
function	ReceiveMessage			parms 0
function	IsMessageWaiting		parms 0
function	GetMessageSender		parms 0
function	GetMessageSenderId		parms 0
function	ReplySender			parms 1
function	DeleteMessage			parms 0
function	SendBroadcast			parms 1
function	ReceiveBroadcast		parms 0
function	DeleteBroadcast			parms 0
function	IsBroadcastWaiting		parms 0
function	GetBroadcastSender		parms 0
function	GetBroadcastSenderId		parms 0
function	ReplyBroadcastSender		parms 1

; sync tasks and functions

function	ResetGroupSync			parms 0
function	ResetUserSync			parms 0
task		SyncWithGroup			parms 1
task		SyncWithUser			parms 1
function	ChangeGroup			parms 1
function	ChangeUser			parms 1

; pipelining functions

function	PipeMyGroup			parms 0
function	PipeGroup			parms 1
function	PipeUser			parms 1
function	PipeMasters			parms 0
function	PipeSlaves			parms 0
function	PipeAroundMe			parms 1
function	PipeAroundPos			parms 4
function	PipeHidden			parms 0

; node map negotiation

task		MoveNodeMarker			parms 2
task		MoveNodeLocation		parms 2
task		MoveNodePosition		parms 4
function	AtNodeMarker			parms 2
function	AtNodeLocation			parms 2
function	AtNodePosition			parms 4
function	Wander				parms 2
function	DisableNodeMaps			parms 0
function	EnableNodeMaps			parms 0

; node marker negotiation

task		MoveMarker			parms 2
task		MoveLocation			parms 2
task		MovePosition			parms 4

; weapons and hand-objects

function	DrawSword			parms 0
function	SheathSword			parms 0
function	CheckPlayerWeapon		parms 0
function	DisplayHandModel		parms 4
function	DisplayHandItem			parms 4
function	DisplayHiltModel		parms 4
function	DisplayHiltItem			parms 4

; item's and the inventory

function	HandItem			parms 1
function	HaveItem			parms 1
function	RemoveItem			parms 1
function	ItemUsed			parms 1
function	PushItem			parms 2
function	PopItem				parms 1
function	AddItem				parms 2
function	SubItem				parms 2
function	DropItem			parms 2
function	UseItem				parms 1
function	ShowItem			parms 4
function	ShowItemNoRtx			parms 3
function	ActiveItem			parms 0
function	PushAllItems			parms 1
function	PopAllItems			parms 0
function	DropAllItems			parms 0
function	SelectItem			parms 1

; general object queries

function	IsOnEdge			parms 0
function	IsHoldingWeapon			parms 0
function	IsSheathingSword		parms 0
function	IsDrawingSword			parms 0
function	IsDrawingOrSheathing		parms 0
function	IsCarryingWeapon		parms 0
function	IsCombatCapable			parms 0
function	IsShellScript			parms 0
function	IsWithinView			parms 0
function	IsWithinMap			parms 0
function	IsInAir				parms 0
function	IsLightingOrUnlighting		parms 0
function	IsUnlightingTorch		parms 0
function	IsLightingTorch			parms 0
function	IsInLava			parms 0
function	IsInDeepWater			parms 0
function	IsInWater			parms 0
function	IsBouncing			parms 0

; shell AI functions

function	OpenShell			parms 1
function	CountAiShells			parms 1
function	FindAiShell			parms 1

; effects system

function	AddFlatEffect			parms 6
function	AddLightEffect			parms 8
function	GolemSteam			parms 0
function	DragonBreath			parms 0
multitask	DragonBreathTask		parms 0

; Smacker functions

function	QueueMovie			parms 1

task		TestTask			parms 1
function	XResetCamera			parms 0

; Potion functions

function        SetPotion                       parms 2
function        GetPotion                       parms 1

; Log Book functions

function	AddLog					parms 1

; spare expansion functions, (do nothing at the moment)

function	Spare0Parm0			parms 0
function	Spare1Parm0			parms 0
function	Spare0Parm1			parms 1
function	Spare1Parm1			parms 1
function	Spare0Parm2			parms 2
function	Spare1Parm2			parms 2
function	Spare0Parm3			parms 3
function	Spare1Parm3			parms 3
function	Spare0Parm4			parms 4
function	Spare1Parm4			parms 4
function	Spare0Parm5			parms 5
function	Spare1Parm5			parms 5
function	Spare0Parm6			parms 6
function	Spare1Parm6			parms 6
function	Spare0Parm7			parms 7
function	Spare1Parm7			parms 8


[refs]

; object references

address
next
list
parent
linked
grid
id
name
ftype
sflags
runtime_local_list
runtime_locals
extra
object_data
static_data
loaded_matrix
data
header
pos.vx
pos.vy
pos.vz
slave_pos.vx
slave_pos.vy
slave_pos.vz
last_slave_pos.vx
last_slave_pos.vy
last_slave_pos.vz
start_pos.vx
start_pos.vy
start_pos.vz
last_pos.vx
last_pos.vy
last_pos.vz
last_valid_flag
last_valid_pos.vx
last_valid_pos.vy
last_valid_pos.vz
angle.vx
angle.vy
angle.vz
slave_angle.vx
slave_angle.vy
slave_angle.vz
last_slave_angle.vx
last_slave_angle.vy
last_slave_angle.vz
start_angle.vx
start_angle.vy
start_angle.vz
last_angle.vx
last_angle.vy
last_angle.vz
move.vx
move.vy
move.vz
ov.vx
ov.vy
ov.vz
size
location
yangle_change
rope
rope_id
rope_wait
slide_flag
fall_flag
jump_flag
extra_flag
extra_time
action_flag
action
action_time
arms_time
jump_time
jump_height
origin
origin_time
origin_accum
last_direction
move_counter
last_collide
last_collide_count
under_object
under_surface
surface_time
ai_type
ai_mode
ai_delay
ai_var1
ai_var2
ai_length
node_map
node
dnode
fdnode
weapon_drawn
torch_timer
hand_item
hand_pos.vx
hand_pos.vy
hand_pos.vz
hand_angle.vx
hand_angle.vy
hand_angle.vz
grip[0]
grip[1]
scabbard[0]
scabbard[1]
sphere_object
fsphere_heap
fspheres
active
hide
dead
invisible
combat
light
flat
anim
anim_list
frame
handle
last_frame
last_handle
panic_group
message_index
broadcast_index
anchor
hook_data
script_data
script_int
script_pc
script_return
script_rv
script_ret_rv
attribute
local_index
string_index
disable_script
task[0]
task[1]
task[2]
task[3]
task[4]
task[5]
task_variable[0]
task_variable[1]
task_variable[2]
task_variable[3]
task_variable[4]
task_variable[5]
task_status[0]
task_status[1]
task_status[2]
task_status[3]
task_status[4]
task_status[5]
task_pause[0]
task_pause[1]
task_pause[2]
task_pause[3]
task_pause[4]
task_pause[5]
task_timer[0]
task_timer[1]
task_timer[2]
task_timer[3]
task_timer[4]
task_timer[5]
task_variable2[0]
task_variable2[1]
task_variable2[2]
task_variable2[3]
task_variable2[4]
task_variable2[5]
task_variable3[0]
task_variable3[1]
task_variable3[2]
task_variable3[3]
task_variable3[4]
task_variable3[5]
task_variable4[0]
task_variable4[1]
task_variable4[2]
task_variable4[3]
task_variable4[4]
task_variable4[5]

; object's animation references

anim.address
anim.current
anim.next
anim.next_speed
anim.frame
anim.speed
anim.speed_count
anim.stop_flag
anim.halt_flag
anim.hold_flag
anim.rep_count
anim.rewind_flag
anim.loop_count
anim.sound_handle
anim.real_frame
anim.max_group
anim.pos.vx
anim.pos.vy
anim.pos.vz
anim.angle.vx
anim.angle.vy
anim.angle.vz
anim.last_angle.vx
anim.last_angle.vy
anim.last_angle.vz

; object's size references

size.address
size.orientation
size.size.vx
size.size.vy
size.size.vz
size.pos.vx
size.pos.vy
size.pos.vz
size.psize.vx
size.psize.vy
size.psize.vz
size.msize.vx
size.msize.vy
size.msize.vz



[equates]

; equates section
; equates can be assigned numeric values or the value of a previously defined
; equate.


; object arrtibute equates

auto
	attr_active
	attr_collide
	attr_strength
	attr_health
	attr_armor
	attr_movement
	attr_weight
	attr_ymove
	attr_user_flag = attr_ymove
	attr_forward_speed
	attr_backward_speed
	attr_side_speed
	attr_step_type
	attr_forward_walk
	attr_backward_walk
	attr_combat
	attr_turn_speed
	attr_fight_lunge_speed
	attr_fight_forward_speed
	attr_fight_backward_speed
	attr_fight_forward_walk
	attr_fight_backward_walk
	attr_fight_turn_speed
	attr_fight_turn_accel
	attr_weapon
	attr_player_align
	attr_master
	attr_slave
	attr_slave_type
	attr_rotation
	attr_group
	attr_user
	attr_jump_time
	attr_jump_height
	attr_no_slave_rot
	attr_sheath_frame
	attr_draw_frame
	attr_ignore_own_matrix
	attr_stop_y_rotate
	attr_stop_x_rotate
	attr_stop_z_rotate
	attr_stop_x_move
	attr_stop_y_move
	attr_stop_z_move
	attr_always_sync
	attr_panic_group
	attr_camera_move
	attr_camera_pan_type
	attr_camera_target_offset_x
	attr_camera_target_offset_y
	attr_camera_target_offset_z
	attr_camera_offset_x
	attr_camera_offset_y
	attr_camera_offset_z
	attr_camera_distance
	attr_dialog_y
	attr_no_collide
	attr_no_sphere_object
	attr_mass
	attr_aggression
	attr_combat_defense
	attr_attack
	attr_defend
	attr_attack_skill
	attr_defense_skill
	attr_combat_allies
	attr_combat_alignment
	attr_combat_group
	attr_weapon_type
	attr_armor_type
	attr_death_type
	attr_attack_single
	attr_attack_double
	attr_attack_triple
	attr_attack_thrust
	attr_attack_lunge
	attr_attack_low
	attr_attack_jump_up
	attr_attack_jump_forward
	attr_attack_disarm
	attr_defend_low
	attr_defend_right
	attr_defend_left
	attr_defend_high
	attr_fight_circle_speed
	attr_fight_circle_delta_angle
	attr_num_taunts
	attr_hit_sound
	attr_chatty
	attr_twitch
	attr_stick_to_surface
	attr_node_idle
	attr_node_climbs
	attr_node_jumps
	attr_node_run
	attr_node_in_use			; !!! reserved for internal use do not change in script !!!
	attr_node_ignore_in_sight
	attr_damage
	attr_npc
	attr_bounce_power
	attr_bounce_move
	attr_bounce_turn
	attr_boat_rock_align
	attr_v_weapon
	attr_light_frame
	attr_unlight_frame
	attr_player_type
	attr_special_activate
	attr_fall_hold
	attr_fall_damage
	attr_zap_anim
	attr_holding_weapon
	attr_reload_type
	attr_no_continue
	attr_short_mapping
	attr_no_view_manage
	attr_reserved_weight
	attr_no_node_combat
	attr_lock_pos
	attr_woman
	attr_reserved_collide
	attr_invulnerable
	attr_combat_ignore_in_sight
	attr_non_moving
	attr_combat_long_sight
	attr_combat_radius_weapon
	attr_mess_group
	attr_combat_radius_vhit
endauto


; general equates

false					0
true					1
no					false
yes					true
off					false
on 					true

; axis equates for ..ByAxis tasks

axis_x					0
axis_y					1
axis_z					2
x					axis_x
y					axis_y
z					axis_z

; numerical equates (for multiplication to world units)

degrees					6


; animation groups

auto

; idles and panic groups

	anim_panic
	anim_idle1
	anim_idle2
	anim_idle3
	anim_idle_hurt
	anim_idle_torch
	anim_idle_rope
	anim_idle_ledge
	anim_fight_panic

; misc (low priority)

	anim_misc0
	anim_misc1
	anim_misc2
	anim_misc3
	anim_misc4

; turns

	anim_turn_left
	anim_turn_right
	anim_turn_left_torch
	anim_turn_right_torch

; simple movements

	anim_run
	anim_run_forward = anim_run
	anim_run_backward
	anim_walk
	anim_walk_forward = anim_walk
	anim_walk_forward_torch
	anim_walk_backward
	anim_walk_backward_torch
	anim_step_left
	anim_step_left_torch
	anim_step_right
	anim_step_right_torch
	anim_shimmy_left_ledge
	anim_shimmy_right_ledge
	anim_run_torch
	anim_fight_run

; falling and jumping

	anim_jump_start
	anim_jump_start_torch
	anim_jump_run_start
	anim_jump_right_start = anim_jump_run_start
	anim_jump_right_start_torch
	anim_jump_left_start
	anim_jump_left_start_torch
	anim_jump_torch
	anim_jump
	anim_jump_up = anim_jump
	anim_jump_up_arms
	anim_jump_forward_torch
	anim_jump_forward
	anim_jump_forward_arms
	anim_jump_run
	anim_jump_right = anim_jump_run
	anim_jump_right_torch
	anim_jump_left
	anim_jump_left_torch
	anim_jump_run_arms
	anim_jump_backward
	anim_jump_spin = anim_jump_backward
	anim_jump_backward_torch
	anim_jump_off_rope
	anim_jump_off_rope_sword
	anim_jump_draw_sword
	anim_attack_jump_up
	anim_attack_jump_forward
	anim_fall
	anim_fall_torch
	anim_fall_up_arms
	anim_fall_run
	anim_fall_right = anim_fall_run
	anim_fall_right_torch
	anim_fall_left
	anim_fall_left_torch
	anim_fall_backward
	anim_fall_backward_torch

; land groups

	first_land_group
	anim_land = first_land_group
	anim_land_torch
	anim_land_run
	anim_land_right = anim_land_run
	anim_land_right_torch
	anim_land_left
	anim_land_left_torch
	anim_land_backward
	anim_land_backward_torch
	anim_land_hurt
	anim_land_death
	last_land_group = anim_land_death

; slides

	anim_slide
	anim_slide_down = anim_slide
	anim_slide_forward = anim_slide
	anim_slide_backward
	anim_slide_forward_torch
	anim_slide_backward_torch

; ropes

	anim_rope_panic
	anim_rope_swing_forward
	anim_rope_swing_back
	anim_rope_up
	anim_rope_down
	anim_rope_grab
	anim_rope_jump

; ledges and hand-plants

	anim_pull_up_ledge
	anim_drop_off_ledge
	anim_swing_ledge
	anim_grab_ledge
	anim_hand_plant_ledge

; combat

	anim_draw_sword
	anim_fight_forw
	anim_fight_forward = anim_fight_forw
	anim_fight_back
	anim_fight_backward = anim_fight_back
	anim_fight_circle_left
	anim_fight_circle_right
	anim_fight_turn_left
	anim_fight_turn_right
	anim_defend_low
	anim_defend = anim_defend_low
	anim_defend_right
	anim_defend_left
	anim_defend_high
	anim_attack_1
	anim_attack_2
	anim_attack_3
	anim_attack_thrust
	anim_attack_thrust_start = anim_attack_thrust
	anim_attack_lunge
	anim_attack_1_end
	anim_attack_2_end
	anim_fight_disarm
	anim_attack_low
	anim_fight_jump_start
	anim_fight_jump
	anim_fight_fall
	anim_fight_land
	anim_fight_fall_attack
	anim_fight_land_attack
	anim_fight_hurt_1
	anim_hit_attack = anim_fight_hurt_1
	anim_fight_hurt_2
	anim_fight_hurt_front
	anim_fight_hurt_back
	anim_death_fight_stab
	anim_death_fight_hard
	anim_death_fight_stab_end
	anim_death_fight_hard_end
	anim_death_fight_front
	anim_death_fight_back
	anim_death_fight_front_end
	anim_death_fight_back_end
	anim_sheath_sword
	anim_fight_land_right
	anim_fight_land_left
	anim_explore_hurt_1
	anim_explore_hurt_2
	anim_death_explore

; flask groups

	anim_flask_panic
	anim_draw_flask
	anim_sheath_flask
	anim_catch_spell
	anim_charge_flask
	anim_shoot_flask

; swimming groups

	anim_swim_idle
	first_swim_group = anim_swim_idle
	anim_swim_forward
	anim_swim_backward
	last_swim_group = anim_swim_backward

; special movements

	anim_pickup
	anim_pull_lever_down
	anim_pull_lever_up
	anim_turn_lever_left
	anim_turn_lever_right
	anim_light_torch
	anim_unlight_torch
	anim_light_with_torch

; speech

	anim_still
	anim_talk1
	anim_talk2
	anim_talk3

; misc (high priority)

	anim_misc5
	anim_misc6
	anim_misc7
	anim_misc8
	anim_misc9
	anim_misc10
	anim_misc11
	anim_misc12
	anim_misc13
	anim_misc14
	anim_misc15
	anim_misc16
	anim_misc17
	number_anim_groups
endauto


; animation types

animtype_stop				0
animtype_no_stop			1
animtype_no_panic			2
anim_stop				0
anim_no_stop				1
anim_no_panic				2

; return codes for the function PlayerStatus()

auto
	ps_idle
	ps_jump
	ps_jump_forward
	ps_jump_run_forward
	ps_jump_backward
	ps_fall_forward
	ps_fall_run_forward
	ps_fall_backward
	ps_sliding
	ps_start_pull_up
	ps_pull_up
	ps_draw_sword
	ps_sheath_sword
	ps_ledge_start_pull_up
	ps_ledge_pull_up
	ps_run_forward
	ps_run_backward
	ps_step_left
	ps_step_right
	ps_walk_forward
	ps_walk_backward
	ps_moving
endauto

; ai types

at_none					0
at_find_player				1
at_wander				2
at_player_in_sight			3
at_find_location			4
at_location_in_sight			5

; ai modes

ai_none				 	0
ai_turn_to				1
ai_move_to				2
ai_turn_nearest			 	3
ai_move_nearest		 		4
ai_find_player				5
ai_player_turn_to			6
ai_player_move_to			7
ai_find					8
ai_idle					9
ai_find_location			10

; actions

action_jump_right			1
action_jump_left			2
action_jump				1
action_fall				4
action_forward				8

; collision flags set in object reference last_collide. The last_collide property is a bit-field, so to see if the object
; failed to move left for example use 'if object.last_collide & cf_check_left_fail <> 0'. this if statement will continue
; if the cf_check_left_fail flag was set.

cf_slide_off_wall			1
cf_hit_wall				2
cf_polygon_push_out			4
cf_last_valid_set			8
cf_validate_slope_fail			16
cf_check_left_fail			32
cf_check_right_fail			64
cf_check_forward_fail			128
cf_check_backward_fail			256
cf_check_run_forward_fail		512
cf_managed_collision			1024
cf_validate_forward_failed		2048
cf_premeture_jump_end			4096
cf_premeture_fall			8192
cf_cross_polygon_push			16384

; player type flags for use with the attr_player_type attribute

ply_cyrus				0
ply_gremlin				1
ply_crossbow				2

; error return codes

auto
	err_no_error
	err_task_not_completed
	err_destination_node_not_found
	err_destination_not_in_sight
	err_not_on_node_map
	err_collide
endauto

; reload types for attr_reload_type

auto
	rld_none
	rld_hide
	rld_resurrect
	rld_kill
endauto


; global flags

[flags]

;"Overall gamestate" flags
number		timeofday		1		;1 day, 28 is sunset, 27 is night
bool		after_catacombs		0		;Cyrus has been through the catacombs
bool		after_league		0		;Cyrus has been to the league(Act2)
bool		gremlin			0		;Cyrus is gremlin
bool		after_jail		0		;Cyrus is out of the jail/chase section
bool		after_iszara		0		;Cyrus has rescued Iszara (Act3)
bool		after_dragon		0		;dragon is dead
bool		in_palace		0		;Cyrus is in the palace at the end
bool		won_game		0		;killed richton game over!! YOU WIN!!! Yeh..uh..wait


; "Have" flags
bool		have_gear		false
bool		have_blessing		false
bool		have_drbook		false


; "Dialog" flags	KEN SAYS: PLEASE PUT NEW GLOBALS HERE IN ALPHABETICAL ORDER OR YOU BUY THE DONUTS WHEN DOUBLE VARIABLES PREVENT COMPILING!
;			ANDY SAYS: BLAH BLAH BLAH, FUCK ! MY LEFT LEG JUST FELL OFF

bool	AfterTrap			FALSE	;TRUE after Brennan's Trap dialog
bool	AmuletDone			FALSE	;TRUE after Cyrus delivers amulet to Richton, BETTER to use after_catacombs
bool	AmuletJob			FALSE	;TRUE after Cyrus accepts job from Kotaro
bool	asked_once			FALSE	;TRUE after Cyrus asks one question of either guard in vile's realm
bool	BasilTalk			FALSE	;TRUE after beginning of first dialog with basil
bool	BrennanWarn			FALSE	;TRUE after someone warns you of Brennan's Trap
bool	BrennanTrap			FALSE
bool	Brennandead			false	;true
bool	CoyleFriend			FALSE	;TRUE after Cyrus has befriended Coyle	-- KEN: see CyrusFriend -- could be a screwup
bool	Crowns_G			FALSE	;sets like local crowns flag in Dreekius
bool	crendalflask			FALSE	;TRUE after Crendal reveals he has Trithik's map piece
bool	crendalmap			false 	;TRUE after Trithik tells Cyrus what's on his map piece
bool	CyCynic				FALSE	;TRUE after Cyrus acts cynical about Hammerfell's fate in front of Dreekius
bool	CyNoGrem			FALSE	;TRUE after Cyrus is changed back from gremlin to Cyrus
bool	CyrusFriend			FALSE	;TRUE after Cyrus is friends with Coyle	-- KEN: have replaced CYRUSFRIEND wiht CoyleFriend in Saban, Coyle, GC_rock1, GC_rock2
bool	DragonDead			FALSE	;TRUE after Nafaalilargus is dead
bool	Dram_appears			FALSE	;TRUE to have Dram appear and shoot Joto in the jail. can be used for more...
bool	DreekCro			FALSE	;TRUE when Dreekius tells you what he knows about the Crowns during Tobias' dialogue
bool	DreekImp			FALSE	;TRUE when Dreekius tells you about the Imperials' list of dissidents during Tobias' dialogue
bool	DreekiusName			FALSE	;TRUE when Cyrus knows Dreekius' name
bool	DreekiusTalk			FALSE	;TRUE after you first talk to Dreekius
bool	DreekOcc			FALSE	;TRUE when Dreekius tells you what he knows about the Imperial Occupation during Tobias' dialogue
bool	DreekSister			FALSE	;TRUE when Dreekius tells you what he knows about Iszara
bool	EnterCaverns			FALSE	;TRUE if Cyrus has been in the Caverns
bool	EyePieceFound			FALSE
bool	EyePieceLost			FALSE
bool	Fatboy				FALSE	;TRUE after someone explains that Fatboy = Richton
bool	FavisHelp			FALSE
bool	Favis_BELL			FALSE   ;favis tells cyrus about broken bell, and bell.scr can be activated
bool	FavisPrnellPal			FALSE
bool	FixBell				FALSE
bool	FlagshipStory			FALSE	;TRUE after someone tells you the League blew up Richton's flagship
bool	FlaskFalicia			FALSE	;TRUE after Falicia tells Cyrus what she knows about the Flask of Lillandril
bool	Flaskstart			false 	;TRUE after you read the book about the Flask, or ask J'ferr about it or if Joto tells you about it during Scene Five, "The Soulgem"
bool	GremlinSolve			false	;true after cyrus is able to say change me back to anyone
bool	GypsyHelp			FALSE	;TRUE after you agree to help solve Saban's problem
bool	GypsySolve 			false
bool	HaveAmulet			FALSE	;TRUE when Cyrus has the Amulet
bool	HaveGear			FALSE	;TRUE when Cyrus has Dwarven gear
bool	HaveGem				FALSE	;TRUE when Cyrus has soulgem
bool	HaveInsignia			FALSE
bool	HaveLocket			FALSE	;TRUE when Cyrus has Lakene's Locket
bool	HaveRing			FALSE	;TRUE when Cyrus has Voa's Ring
bool	HayleStory			FALSE
bool	HiToFavis			FALSE
bool	HiToSiona			FALSE	;TRUE after Tobias tells you to see Siona
bool	Imperials_G			FALSE	;sets like local imperials flag in Dreekius
bool	IszaraMetHayle			FALSE
bool	Journal				FALSE
bool	jotoinjail			FALSE
bool	killbrennan			false	;set when Brennan is dead
bool	KithJournal			FALSE	;TRUE after Cyrus has read Kithral's Journal
bool	KnowBody			FALSE	;TRUE when Cyrus knows Prince A'tor's body is at the Temple and covered in the stasis field
bool	KnowsJaganvir			FALSE	;TRUE when Cyrus knows from Avik or Falicia that Jaganvir is the new archmage
bool	KotaroTalk			FALSE
number	KrisGuardsKill			0	;number of Cyrus kills the guards in Krisandra's house, should equal 2 before she happy
bool	KrisGuardsSee			FALSE	;TRUE after Cyrus enters Krisandra's house while guards are searching it (only after FlaskStart = TRUE)
bool	LakeneDen			FALSE	;TRUE after someone tells Cyrus that Lakene knows about SD. (Krisandra, Favis?)
bool	LakeneMove			FALSE	;TRUE when Cyrus confronts Lakene and he moves
bool	LakeneTalk			FALSE	;TRUE after Cyrus talks to Lakene
bool	Makemap				false	;true after cyrus gives maiko the elven book, used to trigger maiko to start map working anim
bool	Mapfin				FALSE	;true after counter finishes, used to time maiko working on map for cyrus
bool	MariahTellIszara		FALSE	;TRUE if Mariah tells you she saw Iszara at Maiko's
bool	NecroDone			FALSE	;TRUE after Cyrus completes the amulet delivery under the auspice of N'gasta rather than Kotaro
bool	NecroJob			FALSE	;TRUE after Cyrus accepts amulet job from N'gasta instead of Kotaro
bool	NeedFixObserv			FALSE	;TRUE after Erasmo tells Cyrus that observatory must be fixed.
bool	NeedPassword			FALSE	;TRUE after someone tells you that you need a password to get into Smuggler's Den (SmugglersDen is true and knock on door)
bool	NeedProof			FALSE
bool	NewCombs			FALSE	;TRUE when Cyrus enters the second part of the Catacombs
bool	NidalKnow			FALSE
bool	NidalTalk			FALSE	;TRUE if player has spoken with Nidal [set in Brother Nidal; referenced in Tobias]
bool	Occupation_G			FALSE	;sets like local occupation flag in Dreekius
bool	ObservFixed			FALSE	;TRUE after Cyrus fixes the observatory
bool	OpenDoor			FALSE	;TRUE after the Door to the Dwarven Ruins is opened
bool	Open_journal			false	; true after cyrus opens iszara*s journal
bool	Password			FALSE	;TRUE after someone tells you the password to the Smuggler's Den
bool	PrnellFriend			FALSE
bool	flag_picked_up			FALSE	;when false; show Prnell's harbor tower redflag [xflag.scr]; when true, hide redflag
bool	Put_flag_back			false	;prnell allows cy to put flag back
bool	pullbellrope			false	;Cyrus tries to pull bell rope, and Favis says DON'T TRY IT!
bool	RolloAnnoy			FALSE
bool	RolloDen			FALSE	;TRUE after someone tells Cyrus that Rollo knows about Smuggler's Den. (Krisandra, Lakene, Favis?)
bool	RolloHate			FALSE
bool	RolloLocket			FALSE	;TRUE after Lakene tells you Rollo has his wife's locket
bool	RolloTalk			FALSE
bool	SabanCanHelp			FALSE	;TRUE when Cyrus knows Saban can help him out (thus GypsyHelp=TRUE)
bool	SabanSeeTruth			FALSE	;
bool	SeeBrennan			FALSE	;TRUE after someone tells you Brennan is looking for you
bool	SeeCrendal			FALSE	;TRUE if Dreekius tells you that Crendal has a piece of the map- opens up "map" inquiry in Crendal's dialogue
bool	SeenDoor			FALSE	;TRUE when Cyrus sees the Door to the Dwarven Ruins
bool	SionaFriend			FALSE	;TRUE after Siona becomes your friend (by you telling her Tobias is your friend)
bool	SmugglersDen			FALSE	;TRUE after someone tells you about the Smuggler's Den (Siona, Mariah, Gerrick, Prnell)
bool	SoulSnare			FALSE
bool	Spoke_with_Kotaro		FALSE	;TRUE after Cyrus has spoken with Kitaro at least once
bool	stop_talk			FALSE	;disables dialog activation for Basil while Vandar fights
bool	take_flag			FALSE	;lets cyrus take prnell's flag
bool	talking				FALSE	;we set this when cyrus is in dialog
bool	TavernBrawl			FALSE	;TRUE if Cyrus has gotten into a fight with the Forebears at the Draggin Tale.
bool	TempleVisit			FALSE	;TRUE if Cyrus has been to the Temple
bool	TirbInJail			FALSE
bool	TobiasLeave			FALSE	;TRUE after Tobias leaves and Cyrus had known previously that he planned to leave (not the same as ActTwo=TRUE)
bool	TobiasTalk			FALSE	;TRUE after you first talk to Tobias
bool	trithikboat			false 	;TRUE after Lakene mentions Trithick's boat needs fixing.
bool	trithikmap			false 	;TRUE after Trithik tells Cyrus that someone stole his map piece
bool	UseTelescope			FALSE
bool	vandarfight			false	;true after cyrus and vandar fight
bool	weight1_down			false	;weight1 for catacomb weight puzzle
bool	weight2_down			false	;weight2 for catacomb weight puzzle
bool	weight3_down			false	;weight3 for catacomb weight puzzle
bool	WORKMAP				FALSE	;true if makemap is true when cyrus leaves cartographers
bool	Wounded				FALSE	;TRUE if Cyrus is wounded

; "Equipped" flags (at least temporarily, until this is functional in SOUP)
bool		equipped_torch		false
bool		equipped_key_bone	false
bool		equipped_key_palace	false
bool		digging			false	;set when cyrus is digging
bool		dig_item_found		false	;set if something is found when digging
bool		HoldingFlag		false	;shen cyrus is holding flag
bool		torch			false	;true when cyrus has torch out

; "Catacomb flags"
flipflop	ctblock1		false
flipflop	ctblock2		false
flipflop	ctdoor01		false
flipflop	ctdoor02		false
flipflop	ctdoor58		false
flipflop	ctdoor73		false
flipflop	ctdoor86		false
flipflop	ctrot86		 	false
flipflop	ctpad01			false
flipflop	ctpad02			false
flipflop	ctpad03			false
flipflop	ctpad04			false
flipflop	ctpada1			false
flipflop	ctruned		 	false
flipflop	ctcount		 	false
number		ctcounter		false
number		ctcounter2		false
number		ctrack			0
number		ctrakdor		0
flipflop	ctlock01		false
flipflop	ctlock02		false
number		ctweight		0
flipflop	ctwpad01		false
flipflop	ctwpad02		false
flipflop	ctwpad03		false
flipflop	ctwpad04		false
flipflop	ctwpad05		false
flipflop	ctwpad06		false
flipflop	ctwpad07		false
flipflop	ctwpad08		false
flipflop	ctwblade		false
flipflop	ctwdoor1		false
flipflop	ctskey			false
flipflop	ctstop			false
bool		ct_fire		 	false
bool		CatacombsFoundStuff 	false
bool		scene2 			false
bool		scene9			false
bool		Cyrus_face_gem		false
bool		dragon_face_gem		false
bool		Cyrus_face_dragon       false
bool		braze_fire       	false


; "cavern flags"
bool		cv_lock1		false
bool		cv_lock2		false
bool		cv_dor01		false
bool		cv_gear1		false
bool		cv_gate1		false
bool		cv_pillarA1		false
bool		cv_pillarA2		false
bool		cv_pillarB1		false
bool		cv_pillarB2		false
bool		cv_pillarC1		false
bool		cv_pillarC2		false
flipflop	cv_river		false
BOOL		CV_PILLARA		FALSE
BOOL		CV_PILLARB		FALSE
bool		cv_pillarC		false
bool		cv_skull		false
bool		cv_ship			false
bool		cv_sword		false
bool		cv_arm			false
bool		cv_main_door		false
FLIPFLOP	CV_BAIT			FALSE
bool		cv_crack		false	;opens crack to secret brazier

; "Observatory flags"
number		ob_telv			1
number		ob_telh			12
BOOL		OB_PLATFORM		FALSE
BOOL		OB_arms			FALSE
bool		ob_plt_up		false
bool		ob_plt_move		false
bool		ob_look			false
bool		ob_stepup		false
bool		ob_stepdown		false
bool		ob_fixed		false
bool		ob_elevator		false
bool		ob_lift			false
number		ob_lever		0

bool		kurttest1		false
bool		kurttest2		false
bool		ob_engine		false

flipflop	pi_pot			false
bool		pi_pig			false
bool		pi_crane		false
bool		pi_door1		false
bool		pi_door2		false
bool		pi_door3		false
bool		pi_door4		false
bool		pi_door5		false
flipflop	pi_platform		false
flipflop	pi_throneA		false
flipflop	pi_throneB		false
flipflop	pi_throneC		false
FLIPFLOP	PI_THRONED		FALSE
NUMBER		PALACEGUARDSDEAD 	0	;for scene1, counts dead guards
BOOL		DRAMSHOOTCYRUS		FALSE	;for scene1, makes dram shoot cyrus and knock him out
bool		PIOnBlimp 		false



;"NECROMANCER'S FLAGS"
flipflop	ncdoor1			false
bool		open_ncgate		false
flipflop	nchead			false
bool		close_ncdoort1		false
bool		nc_view_skeleton	false
bool		at_shoals 		true		;these are for the boatman's state
bool		at_isle 		false
bool		to_isle 		false
bool		to_shoals 		false
bool		nc_pour_elixir		false
bool		nc_explosion		false
bool		cyrus_at_gate		false	;is true when cyrus arives at tower gate
bool		SerpentDead		false	;when serpent is dead
BOOL		SCENE6			FALSE	;start "The Fate of Iszara" ingame cutscene
bool		NgastaFight		false
bool		scene6_door		false   ; true when the door is closed; playerlineup with iszara; start iszara dialog; from iszara.scr to scene6

;"DWARVEN RUINS FLAGS"
bool		DRarrowLoaded 		false
NUMBER		DR_STEAM		0
bool		dr_boiler		false
bool		dr_boiler_move		false

bool		dr_pipe1		false
bool		dr_pipe2		false
bool		dr_pipe3		false
bool		dr_pipe4		false
bool		dr_pipe5		false
bool		dr_pipe6		false
bool		dr_flower1		false
bool		dr_flower2		false
bool		dr_flower3		false
bool		dr_flower4		false
bool		dr_flower5		false
bool		dr_flower6		false
bool		dr_slider2		false
bool		dr_slider1		false
number		dr_output1		0
number		dr_output2		0
number		dr_output3		0
number		dr_output4		0
number		dr_output5		0
number		dr_output6		0
number		dr_output7		0
number		dr_output8		0

number		dr_steam_done		0
bool		dr_trigger1		false
bool		dr_trigger2		false
bool		dr_door1		false
bool		dr_door1a		false
bool		dr_door2		false
bool		dr_door2a		false
bool		dr_mask			false
number		dr_doorA		0
bool		dr_doorB		false
bool		dr_doorC		false
bool		dr_loader		false
flipflop	dr_laserfire		false
bool		dr_robot		false
bool		dr_golem_dead		false
bool		dr_dorb			false
bool		dr_bridge		false
bool		open_drdoor		false
bool		dr_exdra		false

flipflop	dr_scarab_turn		false
bool		dr_scarab_done		false

number		scb_position		0
number		scb_armL		0
number		scb_armR		0
bool		scb_head		false
flipflop	scb_legs		false
bool		scb_spikes		false
number		scb_door		0
flipflop	scb_chnL		false
flipflop	scb_chnR		false
number		scb_chnM		0
bool		scb_hndL		0
bool		scb_hndR		0
bool		CampDirgFlyAway		false


;"Vile's Realm flags"
bool		vr_door1_activate	false
bool		vr_door2_activate	false
bool		vr_gard1_activate	false
bool		vr_gard2_activate	false
bool		vr_doors_activate	false
bool		talk_now		false		 ;toggle for vilechat crates -- vile comments while exploring
bool		dog_dialog		false		 ;turns off dog morphing for Vile's dialog dog reference
bool		end_vile		false		 ;shifts control from guards to Vile end puzzle dialog
bool		wrong_door		false		 ;Vile dialog after puzzle lose
BOOL		RIGHT_DOOR		FALSE		 ;Vile dialog after puzzle win
bool		vile_choose_right 	false		 ;true if you ask right question and choose right door

;"Hideout flags"
bool		hi_ride			false
bool		sailed_in			false
number          dead_marine             0               ;to determine when all guards are dead
bool            show_marine             false           ;to show marines on boat
bool            dooropen             false           ;when hi_door.scr gets right key, opens door through hi_doorx.scr
number          strike_counter             0            ;if Cyrus activates locked doors or picks fights, three strikes = battles

;"Menu flags"
number 		menuRet			0
bool 		menu1State		0
bool 		menu2State		0
bool 		menu3State		0
bool 		menu4State		0
bool 		menu5State		0
bool 		menu6State		0

;"town flags"
bool		snake_dance		false		;tells aviks snake to dance
flipflop	ts_wheel		false		;town square wheel, bucket
flipflop	bucket_full		false		;tells if there is water in the bucket in town square
flipflop	aloe_in_water		false
flipflop	boatcam1		false		;turns on camera for boat pulling into harbor
flipflop	door_a			false
bool		camera_a		false
bool		DrawbridgeUp		false
bool		bell_ringing		false
bool		rollo_chest		false		;rollo's chest open or closed
bool		silver_chest		false		;krisandra's chest open or closed
bool		brennans_boat 		false		;set by boatstar when player gets away from it after it has arived
bool		boat_arrived		false		;set by boatstar when it lands so brennan knows to move around
bool		brennansHatch		false		;set true when brennan goes, below, sets trap, etc. Hatch to boat can be opened
bool		StartTavernBrawl	false		;set when tavernfight starts
BOOL		BRENNANISLEKILLED 	FALSE		;true if he has been killed on isle



;"mage's guild"
bool		mg_door2		false		;for back door
bool		gremlin_scene		false		;starts gremlin scene, set by falicia
bool		show_jaganvir		false		;if true, show Jaganvir in Mages Guild; set in island map: NEVER true if after_league = true


;"Lighthouse flags"
flipflop	lh_light		false
flipflop	lh_door			false
flipflop	lh_shut			false
bool		YaeliBoat		false		;tells her boat to sail in
bool		YaeliBoatArrived	false
bool		YaeliBoatLeave 		false
bool		YaeliBoatHasLeft 	false

;"gypsy camp"
bool	 	rock_1_down 		true
bool		rock_2_down 		true
bool		rock_1_at_location_1	false
bool		rock_1_at_location_2	false
bool		rock_2_at_location_1	false
BOOL		ROCK_2_AT_LOCATION_2	FALSE
bool		SabanTalk		false

;"jffer's"
bool		seen_dwarven_lore	false		;true when Cyrus has reviewed book of dwarven lore
bool		bought_elven_artifacts	false		;true when Cyrus buys copy of elven artifacts

;
bool		lillandrilInUse		false

;"start map"
NUMBER		DEADPIRATES		0	;number of pirates cyrus has killed
bool		scene5			false	;gary's test shortcut avoiding dialog to the cutscene

number		globaltemp		0	;used for global temp variables


;jail and chase flags
bool		DramStartJailFight 	false	;tells dram to draw sword and begin fighting

NUMBER		STRENGTHTIMER 		0	;timers for effects
NUMBER		ARMORTIMER 		0
number		MapTimer 		0	;for Maiko making map


;potion id's
;1	unicorns horn
;2 	Daedra's Heart
;3      salamander
;4	Amber
;5	Spriggan's ear
;6	saint's hair
;7	pig's sac
;8	lich dust